import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';

export async function deleteByPrimaryKeyForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/get?${stringify(params)}`);
}


export async function insertForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a02/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getJobGradeInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a03/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getPATJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a05/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getPoliceRankInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a10/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getEduInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a12/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getTrainInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a15/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function getCheckInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a17/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getCurriculumInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a32/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getFamilyMemberInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a33/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getDisciplineInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a50/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForProUser(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/prouser/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function getProDeptTreeByLevelCode(params = {}) {
    return request(`/${webpath}/web/api/service/prodept/getProDeptTreeByLevelCode`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function getProOrgTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/proorg/getProOrgTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllAuthForUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getAllAuthForUser`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getProDeptTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/prodept/getProDeptTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllPostForUser(params = {}) {
    return request(`/${webpath}/web/api/service/post/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function getAllChildren(params = {}) {
    return request(`/hressentialinformation/web/api/service/dictitem/getAllDictitem`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertForStaff(params = {}) {
    return request(`/hressentialinformation/web/api/service/a01/insert`, {
        method: 'POST',
        data: params.formdata
    });
}

export async function updateForStaffBaseInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a01/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a02/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffJobGradeInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a03/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffPATJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a05/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffPoliceRankInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a10/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffEduInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a12/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffTrainInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a15/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffCheckInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a17/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffCurriculumInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a32/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffFamilyMemberInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a33/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffDisciplineInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a50/update`, {
        method: 'POST',
				data: params.formdata
    });
}

export async function updateForStaffContactInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersoncommunicationinformation/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function updateForStaffAccountInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/propersonaccountinformation/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function insertForStaffJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a02/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffJobGradeInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a03/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffPATJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a05/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffPoliceRankInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a10/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffEduInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a12/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffTrainInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a15/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffCheckInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a17/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffCurriculumInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a32/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffFamilyMemberInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a33/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffDisciplineInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a50/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function insertForStaffEducationInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonEducationalExperience/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForStaffEducationInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonEducationalExperience/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteForStaffJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a02/delete?${stringify(params)}`);
}

export async function deleteForStaffJobGradeInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a03/delete?${stringify(params)}`);
}

export async function deleteForStaffPATJobInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a05/delete?${stringify(params)}`);
}

export async function deleteForStaffPoliceRankInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a10/delete?${stringify(params)}`);
}

export async function deleteForStaffEduInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a12/delete?${stringify(params)}`);
}

export async function deleteForStaffTrainInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a15/delete?${stringify(params)}`);
}

export async function deleteForStaffCheckInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a17/delete?${stringify(params)}`);
}

export async function deleteForStaffCurriculumInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a32/delete?${stringify(params)}`);
}

export async function deleteForStaffFamilyMemberInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a33/delete?${stringify(params)}`);
}

export async function deleteForStaffDisciplineInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a50/delete?${stringify(params)}`);
}

export async function deleteForStaffEducationInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonEducationalExperience/delete?${stringify(params)}`);
}

export async function insertForStaffWorkInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonWorkExperience/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForStaffWorkInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonWorkExperience/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteForStaffWorkInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonWorkExperience/delete?${stringify(params)}`);
}

export async function insertForStaffTrainInfo1(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonTraining/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForStaffTrainInfo1(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonTraining/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },

    });
}

export async function deleteForStaffTrainInfo1(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersonTraining/delete?${stringify(params)}`);
}

export async function insertForStaffCertificateInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersoncertificate/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForStaffCertificateInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersoncertificate/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteForStaffCertificateInfo(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/proPersoncertificate/delete?${stringify(params)}`);
}

export async function deleteByPrimaryKeyForProStaff(params = {}) {
    return request(`/hressentialinformation/web/api/service/a01/delete?${stringify(params)}`);
}

export async function queryPageForProStaff(params = {}) {
    return request(`/hressentialinformation/web/api/service/a01/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllStaffInfo(params = {}) {
    return request(`/hressentialinformation/web/api/service/a01/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function upLoadListPersonInformation(params = {}) {
    return request(`/hrpersonmamagement/web/api/service/personinformation/upLoadListPersonInformation`, {
        method: 'POST',
        data: {
        	...params,
          method: 'insert',
        },
    });
}

export async function uploadImage(params = {}) {
    return request(`/hrfilestore/minio/uploadImage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
        headers:{
          "Content-Type": "multipart/form-data"
        }
    });
}
